package com.SJSX.controller;

import java.util.List;

public class ArticleController  {
    @Autowired
    private ArticleService articleService;

    @PostMapping("/add")
    public Result add(@RequestBody Article article){
        System.out.println(article);
        articleService.add(article);
        return Result.success();
    }
    @GetMapping("/findByid")
    public Result findid(@RequestParam Integer id){
        System.out.println(id);
        Article res = articleService.findid(id);
        return Result.success(article);
    }
    @GETMapping("/findByid")
    public Result<List<Article>>findByid(@RequestParam Integer id){
        System.out.println(id);
        List<Article> res = articleService.findByid(id);
        return Result.success(res);
    }
    
}
